<?php
/**
 * Created by PhpStorm.
 * User: 颖inv
 * Date: 2016/11/2
 * Time: 20:02
 */
?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>用户信息编辑</title>
    <style>
        h1{text-align: center;}
        .title{text-align: left; margin: 0 auto;}
        th{text-align: right;}
        body{border: solid 3px lightgray; width: 400px; height: auto; }
    </style>
</head>
<body>
<h1>编辑个人资料</h1>
<form method="post">
    <table class="title">
        <tr><th>昵称：</th><td><input type="text" name="nickname" value="<?php echo $data['nickname'];?>"/></td></tr>
        <tr><th>性别：</th><td>
                <input type="radio" name="gender" value="男"<?php if ($data['gender']=='男') echo 'checked';?>/>男
                <input type="radio" name="gender" value="女"<?php if ($data['gender']=='女') echo 'checked';?>/>女
            </td></tr>
        <tr><th>邮箱：</th><td><input type="text" name="email" value="<?php echo $data['email'];?>"/></td></tr>
        <tr><th>QQ号：</th><td><input type="text" name="qq" value="<?php echo $data['qq'];?>"/></td></tr>
        <tr><th>个人主页：</th><td><input type="text" name="url" value="<?php echo $data['url'];?>"/></td></tr>
        <tr><th>所在城市：</th><td><select name="city"><option value="未选择">未选择</option>
                    <?php foreach ($city as $v):?>
                        <option value="<?php echo $v ?>"<?php if ($data['city']== $v) echo 'selected'; ?>><?php echo $v ?></option>
                    <?php endforeach; ?>
                </select></td></tr>
        <tr><th>语言技能：</th><td>
                <?php foreach ($skill as $v): ?>
                    <input type="checkbox" name="skill[]" value="<?php echo $v;?>"
                    <?php if (in_array($v,$data['skill'])) echo 'checked'; ?>/><?php echo $v; ?>
                <?php endforeach; ?>
                <!--                <input type="checkbox" name="skill[]" value="HTML"/>HTML-->
                <!--                <input type="checkbox" name="skill[]" value="JavaScript"/>JavaScript-->
                <!--                <input type="checkbox" name="skill[]" value="PHP"/>PHP-->
                <!--                <input type="checkbox" name="skill[]" value="C++"/>C++-->
            </td></tr>
        <tr><th>自我介绍：</th><td><textarea class="description" name="description">
                    <?php echo $data['description']; ?>
                </textarea></td></tr>
        <tr>
            <td colspan="2" class="out">
                <input type="submit" value="保存资料" class="button"/>
                <input type="reset" value="重新填写" class="button"/>
            </td></tr>
    </table>
</form>
</body>
</html>